package com.hui.blog_server.controller;

import com.hui.blog_server.entity.Music;
import com.hui.blog_server.entity.ResponseResult;
import com.hui.blog_server.service.MusicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
public class MusicController {

    @Autowired
    private MusicService musicService;

    @GetMapping("/music")
    public ResponseResult<List<Music>> music() {
        return ResponseResult.success(musicService.getAllMusic());
    }
}
